function [discount,beca,stipend] = u45_2010(math,lang,demrecode)
%% Universidad Alberto Hurtado
lm=(math+lang)/2;
beca=zeros(size(lm,1),1);
stipend=zeros(size(lm,1),1);

%Beca Excelencia 100% toda la carrera
discount=(lm>=700);

%Beca exelencia primer a;o
if (demrecode==45014 || demrecode==45030 || demrecode==45024 || demrecode==45033 || demrecode==45028 || demrecode==45026 || demrecode==45034 || demrecode==45010 || demrecode==45017 || demrecode==45011 || demrecode==45006 || demrecode==45004)
    auxdiscount=0.25*(lm>=620)+0.25*(lm>=630)+0.2*(lm>=650);
    discount=max(discount,auxdiscount);
elseif demrecode==45031
    auxdiscount=0.25*(lm>=640)+0.25*(lm>=670)+0.2*(lm>=680);
    discount=max(discount,auxdiscount);
elseif demrecode==45002
    auxdiscount=0.5*(lm>=670)+0.2*(lm>=680);
    discount=max(discount,auxdiscount);
end

%Beca exelencia toda la carrera
if demrecode==45009
    auxdiscount=0.1*(lm>=630)+0.15*(lm>=640)+0.25*(lm>=650)+0.2*(lm>=670)+0.3*(lm>=680);
    discount=max(discount,auxdiscount);
elseif demrecode==45001 || demrecode==45005
    auxdiscount=0.25*(lm>=640)+0.25*(lm>=650)+0.2*(lm>=670)+0.3*(lm>=680);
    discount=max(discount,auxdiscount);
end

end
